package com.sinosoft.cnmuseum.utils;

public class PageUtil {
	// 当前页
	private int pagenumber;
	// 每页数量
	private int pagesize;
	// 总数量
	private int total;
	// 中页数
	private int pagetotal;
	
	private int start;
	private int end;
	
	
	public PageUtil(int pagenumber, int pagesize, int total) {
		this.pagenumber = pagenumber;
		this.pagesize = pagesize;
		this.total = total;
		this.pagetotal =  total/pagesize;
		if(total%pagesize!=0){
			this.pagetotal += 1;
		}
		end = pagenumber*pagesize;
		start = end-pagesize<0?0:end-pagesize;
	}


	public int getPagenumber() {
		return pagenumber;
	}


	public void setPagenumber(int pagenumber) {
		this.pagenumber = pagenumber;
	}


	public int getPagesize() {
		return pagesize;
	}


	public void setPagesize(int pagesize) {
		this.pagesize = pagesize;
	}


	public int getTotal() {
		return total;
	}


	public void setTotal(int total) {
		this.total = total;
	}


	public int getStart() {
		return start;
	}


	public void setStart(int start) {
		this.start = start;
	}


	public int getEnd() {
		return end;
	}


	public void setEnd(int end) {
		this.end = end;
	}


	public int getPagetotal() {
		return pagetotal;
	}


	public void setPagetotal(int pagetotal) {
		this.pagetotal = pagetotal;
	}
	

}
